/* $RCSFile: Crm4SdkHelpers.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/Crm4SdkHelpers.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:31  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Diagnostics;
using System.Net;
using System.Collections.Generic;
using System.Text;

using AddonNice.CRMWrapper.CRM4Server;
//using AddonNice.CRMWrapper.CRM4Meta;
using AddonNice.CRMWrapper.CRM4ADDisco;

// June 06 2008
// CSU
// Main types and create structures identicals to Crm V3
// From CRM4 sdk enums
namespace CrmSdk.CRM4
{
	
	public class CrmTypes
	{
		private static DateTime _minDateTime = new System.DateTime(1900, 1, 1);
		private static DateTime _maxDateTime = new System.DateTime(9999, 12, 30, 23, 59, 59);
		private CrmTypes()
		{
		}
		public static DateTime MinDateTime
		{
			get
			{
				return _minDateTime;
			}
		}
		public static DateTime MaxDateTime
		{
			get
			{
				return _maxDateTime;
			}
		}
		public static CrmBoolean CreateCrmBoolean(Boolean value)
		{
			CrmBoolean result = new CrmBoolean();
			result.Value = value;
			return result;
		}
		public static CrmBooleanProperty CreateCrmBooleanProperty(String name, CrmBoolean value)
		{
			CrmBooleanProperty result = new CrmBooleanProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static CrmDateTime CreateCrmDateTime(String value)
		{
			CrmDateTime result = new CrmDateTime();
			result.Value = value;
			return result;
		}
		public static CrmDateTimeProperty CreateCrmDateTimeProperty(String name, CrmDateTime value)
		{
			CrmDateTimeProperty result = new CrmDateTimeProperty();
			result.Name             =   name;
			result.Value            =   value;
			return result;
		}
		public static CrmDecimal CreateCrmDecimal(Decimal value)
		{
			CrmDecimal result       =   new CrmDecimal();
			result.Value            =   value;
			return result;
		}
		public static CrmDecimalProperty CreateCrmDecimalProperty(String name, CrmDecimal value)
		{
			CrmDecimalProperty result = new CrmDecimalProperty();
			result.Name             =   name;
			result.Value            =   value;
			return result;
		}
		public static CrmFloat CreateCrmFloat(double value)
		{
			CrmFloat result         =   new CrmFloat();
			result.Value            =   value;
			return result;
		}
		public static CrmFloat CreateCrmFloat(float value)
		{
			CrmFloat result         =   new CrmFloat();
			result.Value            =   value;
			return result;
		}
		public static CrmFloatProperty CreateCrmFloatProperty(String name, CrmFloat value)
		{
			CrmFloatProperty result =   new CrmFloatProperty();
			result.Name             =   name;
			result.Value            =   value;
			return result;
		}
		public static CrmMoney CreateCrmMoney(Decimal value)
		{
			CrmMoney result         =   new CrmMoney();
			result.Value            =   value;
			return result;
		}
		public static CrmMoneyProperty CreateCrmMoneyProperty(String name, CrmMoney value)
		{
			CrmMoneyProperty result = new CrmMoneyProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static CrmNumber CreateCrmNumber(Int32 value)
		{
			CrmNumber result = new CrmNumber();
			result.Value = value;
			return result;
		}
		public static CrmNumberProperty CreateCrmNumberProperty(string name, CrmNumber value)
		{
			CrmNumberProperty result = new CrmNumberProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Customer CreateCustomer(string type, Guid value)
		{
			Customer result = new Customer();
			result.type = type;
			result.Value = value;
			return result;
		}
		public static CustomerProperty CreateCustomerProperty(string name, Customer value)
		{
			CustomerProperty result = new CustomerProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}

		public static DynamicEntityArrayProperty CreateDynamicEntityArrayProperty(string name, DynamicEntity[] value)
		{
			DynamicEntityArrayProperty result = new DynamicEntityArrayProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static EntityNameReference CreateEntityNameReference(String value)
		{
			EntityNameReference result = new EntityNameReference();
			result.Value = value;
			return result;
		}
		public static EntityNameReferenceProperty CreateEntityNameReferenceProperty(String name, EntityNameReference value)
		{
			EntityNameReferenceProperty result = new EntityNameReferenceProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Key CreateKey(Guid value)
		{
			Key result = new Key();
			result.Value = value;
			return result;
		}
		public static KeyProperty CreateKeyProperty(String name, Key value)
		{
			KeyProperty result = new KeyProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Lookup CreateLookup(String type, Guid value)
		{
			Lookup result = new Lookup();
			result.type = type;
			result.Value = value;
			return result;
		}
		public static LookupProperty CreateLookupProperty(String name, Lookup value)
		{
			LookupProperty result = new LookupProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Owner CreateOwner(String type, Guid value)
		{
			Owner result = new Owner();
			result.type = type;
			result.Value = value;
			return result;
		}
		public static OwnerProperty CreateOwnerProperty(String name, Owner value)
		{
			OwnerProperty result = new OwnerProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Picklist CreatePicklist(Int32 value)
		{
			Picklist result = new Picklist();
			result.Value = value;
			return result;
		}
		public static PicklistProperty CreatePicklistProperty(String name, Picklist value)
		{
			PicklistProperty result = new PicklistProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static StateProperty CreateStateProperty(String name, String value)
		{
			StateProperty result = new StateProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static Status CreateStatus(Int32 value)
		{
			Status result = new Status();
			result.Value = value;
			return result;
		}
		public static StatusProperty CreateStatusProperty(String name, Status value)
		{
			StatusProperty result = new StatusProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static StringProperty CreateStringProperty(String name, String value)
		{
			StringProperty result = new StringProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static UniqueIdentifier CreateUniqueIdentifier(Guid value)
		{
			UniqueIdentifier result = new UniqueIdentifier();
			result.Value = value;
			return result;
		}
		public static UniqueIdentifierProperty CreateUniqueIdentifierProperty(String name, UniqueIdentifier value)
		{
			UniqueIdentifierProperty result = new UniqueIdentifierProperty();
			result.Name = name;
			result.Value = value;
			return result;
		}
		public static CrmDateTime CreateCrmDateTimeFromUser(DateTime userTime)
		{
			return CreateCrmDateTime(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:s}", userTime));
		}
		public static CrmDateTime CreateCrmDateTimeFromUniversal(DateTime universalTime)
		{
			return CreateCrmDateTime(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:s}Z", universalTime));
		}
	}

    	public static class MessageProcessingStage
	{
		public const int BeforeMainOperationOutsideTransaction = 10;
		public const int AfterMainOperationOutsideTransaction = 50;
	}

	public static class MessageProcessingMode
	{
		public const int Synchronous = 0;
		public const int Asynchronous = 1;
	}

	/// <summary>
	/// Deployment that the plug-in supports. 
	/// </summary>    
	public static class SupportedDeployment
	{
		public const int ServerOnly = 0;
		public const int OutlookClientOnly = 1;
		public const int Both = 2;
	}

	/// <summary>
	/// Indicates the availability of a message.
	/// </summary>
	public static class MessageAvailability
	{
		public const int Server = 0;
		public const int Client = 1;
		public const int All = 2;
	}


	public static class MessageName
	{
		public const string Assign = "Assign";
		public const string Create = "Create";
		public const string Delete = "Delete";
		public const string DeliverIncoming = "DeliverIncoming";
		public const string DeliverPromote = "DeliverPromote";
		public const string Merge = "Merge";
		public const string Route = "Route";
		public const string Retrieve = "Retrieve";
		public const string RetrieveMultiple = "RetrieveMultiple";
		public const string SetState = "SetState";
		public const string SetStateDynamicEntity = "SetStateDynamicEntity";
		public const string Send = "Send";
		public const string Update = "Update";
	}

	/// <summary>
	/// Type of asynchronous operation.
	/// </summary>
	public static class AsyncOperationType
	{
		// Note: DO NOT renumber this enumberation.  
		//  Data in newimport.xml uses these values.
		public const int Event = 1;
		public const int BulkEmail = 2;
		public const int Parse = 3;
		public const int Transform = 4;
		public const int Import = 5;
		public const int ActivityPropagation = 6;
		public const int PublishDuplicateRule = 7;
		public const int BulkDetectDuplicates = 8;
		public const int CollectSqmData = 9;
		public const int Workflow = 10;
		public const int QuickCampaign = 11;
		public const int PersistMatchCode = 12;
	}

	/// <summary>
	/// Operation status provides further information for each particular asynchronous operation state.
	/// </summary>
	public static class AsyncOperationStatus
	{
													// State that status is valid for:
		public const int WaitingForResources = 0;	// Ready
		public const int Waiting = 10;				// Suspended
		public const int InProgress = 20;			// Locked
		public const int Pausing = 21;				// Locked
		public const int Canceling = 22;			// Locked
		public const int Succeeded = 30;			// Completed
		public const int Failed = 31;				// Completed
		public const int Canceled = 32;				// Completed
	}

	public static class ParameterName
	{
        public const string Assignee = "Assignee";
        public const string BusinessEntity = "BusinessEntity";
        public const string BusinessEntityCollection = "BusinessEntityCollection";
		public const string ColumnSet = "columnset";
		public const string Context = "context";
		public const string Id = "id";
		public const string EmailId = "emailid";
		public const string SubordinateId = "subordinateid";
        public const string EntityId = "EntityId";
		public const string EntityMoniker = "entityMoniker";
        public const string Query = "Query";
		public const string State = "state";
		public const string Status = "status";
		public const string Target = "Target";
		public const string UpdateContent = "UpdateContent";

		public const string PreBusinessEntity = "PreBusinessEntity";
		public const string PreMasterBusinessEntity = "PreMasterBusinessEntity";
		public const string PreSubordinateBusinessEntity = "PreSubordinateBusinessEntity";
		public const string PostBusinessEntity = "PostBusinessEntity";
		public const string PostMasterBusinessEntity = "PostMasterBusinessEntity";
	}

	/// <summary>
	/// Activity party types.
	/// </summary>
	public static class ActivityPartyType
	{
		public const int Sender = 1;
		public const int ToRecipient = 2;
		public const int CcRecipient = 3;
		public const int BccRecipient = 4;
		public const int Requiredattendee = 5;
		public const int Optionalattendee = 6;
		public const int Organizer = 7;
		public const int Regarding = 8;
		public const int Owner = 9;
		public const int Resource = 10;
		public const int Customer = 11;
		public const int Partner = 12;
	}

	/// <summary>
	/// Advanced find startup modes.
	/// </summary>
	public static class AdvancedFindStartupMode
	{
		public const int Simple = 1;
		public const int Detailed = 2;
	}

	/// <summary>
	/// Bulk operations statuses.
	/// </summary>
	public static class BulkOperationStatus
	{
		public const int Pending = 1;
		public const int InProgress = 2;
		public const int Aborted = 3;
		public const int Completed = 4;
		public const int Cancelled = 5;
	}

	/// <summary>
	/// Bulk operation types.
	/// </summary>
	public static class BulkOperationType
	{
		public const int CreateActivities = 2;
		public const int SendDirectMail = 3;
		public const int Propagate = 4;
		public const int Execute = 5;
		public const int MiniCampaign = 7;
	}

	/// <summary>
	/// Marketing campaign channel types.
	/// </summary>
	public static class CampaignActivityChannelType
	{
		public const int Phone = 1;
		public const int Appointment = 2;
		public const int Letter = 3;
		public const int LetterViaMailMerge = 4;
		public const int Fax = 5;
		public const int FaxViaMailMerge = 6;
		public const int Email = 7;
		public const int EmailViaMailMerge = 8;
	}

	/// <summary>
	/// Marketing campaign response channel types.
	/// </summary>
	public static class CampaignResponseChannelType
	{
		public const int Email = 1;
		public const int Phone = 2;
		public const int Fax = 3;
		public const int Letter = 4;
		public const int Appointment = 5;
	}

	/// <summary>
	/// Cascading operations.
	/// </summary>
	public static class CascadeOps
	{
		public const int CascadeNone = 0;
		public const int CascadeDeepAll = 2;
	}

	/// <summary>
	/// Constraint based group type codes.
	/// </summary>
	public static class ConstraintBasedGroupTypeCode
	{
		public const int Static = 0;
		public const int Dynamic = 1;
		public const int Implicit = 2;
	}

	/// <summary>
	/// Contract allotment type codes.
	/// </summary>
	public static class ContractAllotmentTypeCode
	{
		public const int Case = 1;
		public const int Time = 2;
		public const int CoverageDates = 3;
	}

	/// <summary>
	/// Customer address types.
	/// </summary>
	public static class CustomerAddressType
	{
		public const int Account = 1;
		public const int Contact = 2;
	}

	/// <summary>
	/// Deletion state codes.
	/// </summary>
	public static class DeletionStateCode
	{
		public const int Active = 0;
		public const int SoftDelete = 1;
		public const int HardDelete = 2;
	}

	/// <summary>
	/// Email acceptance decision codes.
	/// </summary>
	public static class EmailDecisionReason
	{
		public const int Unknown = -1;
		public const int Duplicate = 0;
		public const int NoToken = 1;
		public const int NoTokenMatch = 2;
		public const int TokenMatch = 3;
		public const int NoRecipientMatch = 4;
		public const int InternalEmailReject = 5;
	}

	/// <summary>
	/// Event directions.
	/// </summary>
	public static class EventDirection
	{
		public const int Incoming = 0;
		public const int Outgoing = 1;
		public const int Internal = 2;
	}

	/// <summary>
	/// Extent codes.
	/// </summary>
	public static class ExtentCode
	{
		public const int Transparent = 0;
		public const int SubtractRecurrenceIntervals = 1;
		public const int SubtractResults = 2;
	}

	/// <summary>
	/// Inheritance masks.
	/// </summary>
	public static class InheritanceMask
	{
		public const int InheritNone = 0;
		public const int InheritProcesstemplate = 1;
		public const int InheritEmailtemplate = 2;
		public const int InheritReferralsource = 4;
		public const int InheritCompetitor = 8;
		public const int InheritSalesprocess = 16;
		public const int MustInheritProcesstemplate = 32;
		public const int MustInheritEmailtemplate = 64;
		public const int MustInheritReferralsource = 128;
		public const int MustInheritCompetitor = 256;
		public const int MustInheritSalesprocess = 512;
		public const int InheritAll = 1023;
	}

	/// <summary>
	/// Marketing campaign list types.
	/// </summary>
	public static class ListType
	{
		public const int Account = 1;
		public const int Contact = 2;
		public const int Lead = 4;
	}

	/// <summary>
	/// Lookup source type for LookUpMapping
	/// </summary>
	public static class LookUpSourceType
	{
		public const int Source = 0;
		public const int System = 1;
	}

	/// <summary>
	/// Price methods.
	/// </summary>
	public static class PriceMethod
	{
		public const int CurrencyAmount = 1;
		public const int PercentListPrice = 2;
		public const int MarkupCurrentCost = 3;
		public const int MarginCurrentCost = 4;
		public const int MarkupStandardCost = 5;
		public const int MarginStandardCost = 6;
	}

	/// <summary>
	/// Pricing error codes.
	/// </summary>
	public static class PricingErrorCode
	{
		public const int None = 0;
		public const int DetailError = 1;
		public const int MissingPriceLevel = 2;
		public const int InactivePriceLevel = 3;
		public const int MissingQuantity = 4;
		public const int MissingUnitPrice = 5;
		public const int MissingProduct = 6;
		public const int InvalidProduct = 7;
		public const int MissingPricingCode = 8;
		public const int InvalidPricingCode = 9;
		public const int MissingUom = 10;
		public const int ProductNotInPriceLevel = 11;
		public const int MissingPriceLevelAmount = 12;
		public const int MissingPriceLevelPercentage = 13;
		public const int MissingPrice = 14;
		public const int MissingCurrentCost = 15;
		public const int MissingStandardCost = 16;
		public const int InvalidPriceLevelAmount = 17;
		public const int InvalidPriceLevelPercentage = 18;
		public const int InvalidPrice = 19;
		public const int InvalidCurrentCost = 20;
		public const int InvalidStandardCost = 21;
		public const int InvalidRoundingPolicy = 22;
		public const int InvalidRoundingOption = 23;
		public const int InvalidRoundingAmount = 24;
		public const int PriceCalculationError = 25;
		public const int InvalidDiscountType = 26;
		public const int DiscountTypeInvalidState = 27;
		public const int InvalidDiscount = 28;
		public const int InvalidQuantity = 29;
		public const int InvalidPricingPrecision = 30;
		public const int MissingProductDefaultuom = 31;
		public const int MissingProductUomschedule = 32;
	}

	/// <summary>
	/// Priority codes.
	/// </summary>
	public static class PriorityCode
	{
		public const int Low = 0;
		public const int Medium = 1;
		public const int High = 2;
	}

	/// <summary>
	/// Quantity selling codes.
	/// </summary>
	public static class QuantitySellingCode
	{
		public const int NoControl = 1;
		public const int Whole = 2;
		public const int WholeAndFraction = 3;
	}

	/// <summary>
	/// Queue type codes.
	/// </summary>
	public static class QueueTypeCode
	{
		public const int Public = 1;
		public const int Private = 2;
		public const int Wipbin = 3;
	}

	/// <summary>
	/// Report type codes.
	/// </summary>
	public static class ReportTypeCode
	{
		public const int ReportingServices = 1;
		public const int File = 2;
		public const int Link = 3;
	}

	/// <summary>
	/// Report visibility codes.
	/// </summary>
	public static class ReportVisibilityCode
	{
		public const int ReportsGrid = 1;
		public const int Form = 2;
		public const int Grid = 3;
	}

	/// <summary>
	/// Report link type codes.
	/// </summary>
	public static class ReportLinkTypeCode
	{
		public const int DrillThrough = 1;
		public const int SubReport = 2;
		public const int Both = 3;
	}

	/// <summary>
	/// Marketing automation response codes.
	/// </summary>
	public static class ResponseCode
	{
		public const int Unsubscribe = 0;
		public const int Info = 1;
		public const int Interested = 2;
	}

	/// <summary>
	/// Number rounding options.
	/// </summary>
	public static class RoundingOption
	{
		public const int EndsIn = 1;
		public const int MultipleOf = 2;
	}

	/// <summary>
	/// Number rounding policy.
	/// </summary>
	public static class RoundingPolicy
	{
		public const int None = 1;
		public const int Up = 2;
		public const int Down = 3;
		public const int Nearest = 4;
	}

	/// <summary>
	/// Duplicate Rule Operator Types
    /// DuplicateRuleCondition.aspx.cs
	/// </summary>
	public enum DuplicateRuleOperator
	{
		Equals = 0,
		FirstN = 1,
		LastN = 2,
		EqualsDateOnly = 3,
		EqualsDateAndTime = 4,
		EqualsPickListLabel = 5,
		EqualsPickListValue = 6
    }


	/// <summary>
	/// The statuses of DuplicateRule
	/// </summary>
	public enum DuplicateRuleStatus
	{
		Unpublished = 0,
		Publishing = 1,
		Published = 2
	}


	/// <summary>
	/// Saved query types.
	/// </summary>
	public static class SavedQueryType
	{
		public const int MainApplicationView = 0;
		public const int AdvancedSearch = 1;
		public const int SubGrid = 2;
		public const int QuickfindSearch = 4;
		public const int Reporting = 8;
		public const int OfflineFilters = 16;
		public const int MaSearch = 32;
		public const int LookupView = 64;
		public const int SmAppointmentbookView = 128;
		public const int OutlookFilters = 256;
	}

	/// <summary>
	/// Task statuses.
	/// </summary>
	public static class TaskStatus
	{
		public const int Null = 0;
		public const int Notstarted = 1;
		public const int Started = 2;
		public const int Inprogress = 3;
		public const int Completed = 4;
		public const int Aborted = 5;
	}

	/// <summary>
	/// Email statuses.
	/// </summary>
	public static class EmailStatus
	{
		public const int Draft = 1;
		public const int Completed = 2;
		public const int Sent = 3;
		public const int Received = 4;
		public const int Canceled = 5;
		public const int PendingSend = 6;
		public const int Sending = 7;
		public const int Failed = 8;
	}

	/// <summary>
	/// Time zone codes.
	/// </summary>
	public static class TimeZoneCode
	{
		public const int None = -1;
		public const int DatelineStandardTime = 0;
		public const int SamoaStandardTime = 1;
		public const int HawaiianStandardTime = 2;
		public const int AlaskanStandardTime = 3;
		public const int PacificStandardTime = 4;
		public const int MountainStandardTime = 10;
		public const int MexicoStandardTime2 = 13;
		public const int UsMountainStandardTime = 15;
		public const int CentralStandardTime = 20;
		public const int CanadaCentralStandardTime = 25;
		public const int MexicoStandardTime = 30;
		public const int CentralAmericaStandardTime = 33;
		public const int EasternStandardTime = 35;
		public const int UsEasternStandardTime = 40;
		public const int SaPacificStandardTime = 45;
		public const int AtlanticStandardTime = 50;
		public const int SaWesternStandardTime = 55;
		public const int PacificSaStandardTime = 56;
		public const int NewfoundlandStandardTime = 60;
		public const int EastSouthAmericaStandardTime = 65;
		public const int SaEasternStandardTime = 70;
		public const int GreenlandStandardTime = 73;
		public const int MidAtlanticStandardTime = 75;
		public const int AzoresStandardTime = 80;
		public const int CapeVerdeStandardTime = 83;
		public const int GmtStandardTime = 85;
		public const int GreenwichStandardTime = 90;
		public const int CentralEuropeStandardTime = 95;
		public const int CentralEuropeanStandardTime = 100;
		public const int RomanceStandardTime = 105;
		public const int WestEuropeStandardTime = 110;
		public const int WestCentralAfricaStandardTime = 113;
		public const int EastEuropeStandardTime = 115;
		public const int EgyptStandardTime = 120;
		public const int FleStandardTime = 125;
		public const int GtbStandardTime = 130;
		public const int IsraelStandardTime = 135;
		public const int SouthAfricaStandardTime = 140;
		public const int RussianStandardTime = 145;
		public const int ArabStandardTime = 150;
		public const int EastAfricaStandardTime = 155;
		public const int ArabicStandardTime = 158;
		public const int IranStandardTime = 160;
		public const int ArabianStandardTime = 165;
		public const int CaucasusStandardTime = 170;
		public const int AfghanistanStandardTime = 175;
		public const int EkaterinburgStandardTime = 180;
		public const int WestAsiaStandardTime = 185;
		public const int IndiaStandardTime = 190;
		public const int NepalStandardTime = 193;
		public const int CentralAsiaStandardTime = 195;
		public const int SriLankaStandardTime = 200;
		public const int NorthCentralAsiaStandardTime = 201;
		public const int MyanmarStandardTime = 203;
		public const int SeAsiaStandardTime = 205;
		public const int NorthAsiaStandardTime = 207;
		public const int ChinaStandardTime = 210;
		public const int SingaporeStandardTime = 215;
		public const int TaipeiStandardTime = 220;
		public const int WestAustraliaStandardTime = 225;
		public const int NorthAsiaEastStandardTime = 227;
		public const int KoreaStandardTime = 230;
		public const int TokyoStandardTime = 235;
		public const int YakutskStandardTime = 240;
		public const int AusCentralStandardTime = 245;
		public const int CentralAustraliaStandardTime = 250;
		public const int AusEasternStandardTime = 255;
		public const int EastAustraliaStandardTime = 260;
		public const int TasmaniaStandardTime = 265;
		public const int VladivostokStandardTime = 270;
		public const int WestPacificStandardTime = 275;
		public const int CentralPacificStandardTime = 280;
		public const int FijiStandardTime = 285;
		public const int NewZealandStandardTime = 290;
		public const int TongaStandardTime = 300;
	}

	/// <summary>
	/// Outlook client subscription types.
	/// </summary>
	public static class SubscriptionType
	{
		public const int Offline = 0;    // offline subscription
		public const int Outlook = 1;    // outlook subscription
		public const int ABP = 2;        // address book provider subscription
	}

	public static class ImportProcessCode
	{
		public const int Process = 1;
		public const int Ignore = 2;
	}

	public static class ImportMapType
	{
		public const int Standard = 1;
		public const int OutOfBox = 2;
		public const int InProcess = 3;
	}

    public static class ImportDataDelimiter
    {
        public const int DoubleQuote = 1;
        public const int Null = 2;
        public const int SingleQuote = 3;
    }

	public static class ImportFieldDelimiter
	{
		public const int Colon = 1;
		public const int Comma = 2;
		public const int Tab = 3;
		public const int SemiColon = 4;
	}

	public static class ImportLogPhaseCode
	{
		public const int Parse = 0;
		public const int Transform = 1;
		public const int Import = 2;
	}

	public static class ImportModeCode
	{
		public const int Create = 0;
		public const int Update = 1;
	}

    public static class ImportStatus
    {
        public const int Submitted = 0;
        public const int Parsing = 1;
        public const int Transforming = 2;
        public const int Importing = 3;
        public const int Completed = 4;
        public const int Failed = 5;
    }
    
    /// <summary>
	/// Workflow type.
	/// </summary>
	public static class WorkflowType
	{
		public const int Definition = 1;
		public const int Activation = 2;
	}

	/// <summary>
	/// Type of workflow dependency.
	/// </summary>
	public static class WorkflowDependencyType
	{
		public const int SdkAssociation = 1;
		public const int LocalParameter = 2;
		/// <summary>
		/// PrimaryEntityImage depends on the operation that triggered the workflow and can also change over time.
		/// 
		/// For Delete operation, the value is the same as PrimaryEntityPreImage.
		/// For Create/Update operation, the initial value is the same as PrimaryEntityPostImage.  When workflow is
		/// restarted after wait or delay activity, the value is refreshed with the latest state of the primary entity
		/// in the database.
		/// </summary>
		public const int PrimaryEntityImage = 3;
		public const int PrimaryEntityPreImage = 4;
		public const int PrimaryEntityPostImage = 5;
		public const int RelatedEntityImage = 6;
	}

	/// <summary>
	/// Type of authentication supported.
	/// </summary>
	public sealed class AuthenticationType
	{
		public const int AD = 0;
		public const int Passport = 1;
		public const int SPLA = 2;
	}

	/// <summary>
	/// Image type requested by plugins.
	/// </summary>
	public static class EntityImageType
	{
		public const int PreImage = 0;
		public const int PostImage = 1;
		public const int Both = 2;
	}

	/// <summary>
	/// Methods for email delivery.
	/// </summary>
	public static class EmailDeliveryMethod
	{
		public const int None = 0;
        public const int OutlookClient = 1;
		public const int EmailRouter = 2;
        public const int ForwardMailbox = 3;
    }

	/// <summary>
	/// Participation types for activity parties.
	/// </summary>
	public static class ParticipationType
	{
		public const int Sender = 1;
		public const int Recipient = 2;
		public const int CCRecipient = 3;
		public const int BccRecipient = 4;
		public const int RequiredAttendee = 5;
		public const int OptionalAttendee = 6;
		public const int Organizer = 7;
		public const int Regarding = 8;
		public const int Owner = 9;
		public const int Resource = 10;
		public const int Customer = 11;
		public const int Partner = 12;
	}

	public static class WorkflowStepActivityStatus
	{
		public const int InProgress = 1;
		public const int SuccessfullyCompleted = 2;
		public const int Failed = 3;
	}
}
